package cn.ronghuanet.base.listener;

import cn.ronghuanet.auth.service.IPermissionScanService;
import org.springframework.beans.factory.annotation.Autowired;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

/**
 *  ServletContextListener 是一个监听器父接口
 */
@WebListener
public class PermissionListener implements ServletContextListener {

    @Autowired
    private IPermissionScanService scanService;

    @Override
    public void contextInitialized(ServletContextEvent sce) {
        System.out.println("开始权限扫描......................");
        scanService.scan();
        System.out.println("结束权限扫描......................");
    }
}
